﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MgSoft.Import.Exchange
{
    public class ExchangeController : IExchangeController
    {
        public List<IExchangeComponent> Components { get; protected set; }

        public IExchangeComponent GetComponentByName(string componentName)
        {
            var result = Components.Where(p => p.Name == componentName).SingleOrDefault();
            if (result == null)
            {
                throw new MgException("找不到组件");
            }
            return result;
        }
    }
}
